

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  <meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>Metrics &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/sphinx_highlight.js"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex/" />
    <link rel="search" title="Search" href="../../search/" />
    <link rel="next" title="UADK Acceleration for Compression" href="../uadk-accel/" />
    <link rel="prev" title="Cloud Transition" href="../cloud-transition/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="../../" class="icon icon-home" aria-label="Home"></a></li>
          <li class="breadcrumb-item"><a href="../">Ceph 对象网关</a></li>
      <li class="breadcrumb-item active">Metrics</li>
      <li class="wy-breadcrumbs-aside">
            <a href="../../_sources/radosgw/metrics.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../" class="icon icon-home"> Ceph
          

          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../start/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephadm/">Cephadm</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rados/">Ceph 存储集群</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../">Ceph 对象网关</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../frontends/">HTTP 前端</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multisite/">多站配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../zone-features/">域的功能</a></li>
<li class="toctree-l2"><a class="reference internal" href="../placement/">存储池归置与存储类</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multisite-sync-policy/">多站同步策略配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../pools/">存储池的配置</a></li>
<li class="toctree-l2"><a class="reference internal" href="../config-ref/">配置参考</a></li>
<li class="toctree-l2"><a class="reference internal" href="../admin/">管理指南</a></li>
<li class="toctree-l2"><a class="reference internal" href="../account/">用户账户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s3/">S3 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../iam/">IAM API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../rgw-cache/">数据缓存和 CDN</a></li>
<li class="toctree-l2"><a class="reference internal" href="../swift/">Swift API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../adminops/">管理操作 API</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api/">Python 接口</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nfs/">通过 NFS 导出</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keystone/">与 OpenStack Keystone 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../barbican/">与 OpenStack Barbican 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../vault/">与 HashiCorp Vault 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../kmip/">与 KMIP 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../opa/">与 Open Policy Agent 对接</a></li>
<li class="toctree-l2"><a class="reference internal" href="../multitenancy/">多租户</a></li>
<li class="toctree-l2"><a class="reference internal" href="../compression/">压缩</a></li>
<li class="toctree-l2"><a class="reference internal" href="../ldap-auth/">LDAP 认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../encryption/">服务器端加密</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bucketpolicy/">桶策略</a></li>
<li class="toctree-l2"><a class="reference internal" href="../dynamicresharding/">动态的桶索引重分片</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mfa/">多因子认证</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sync-modules/">同步模块</a></li>
<li class="toctree-l2"><a class="reference internal" href="../notifications/">Bucket Notifications</a></li>
<li class="toctree-l2"><a class="reference internal" href="../layout/">RADOS 中的数据布局</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STS/">STS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../STSLite/">STS Lite</a></li>
<li class="toctree-l2"><a class="reference internal" href="../keycloak/">Keycloak</a></li>
<li class="toctree-l2"><a class="reference internal" href="../session-tags/">Session Tags</a></li>
<li class="toctree-l2"><a class="reference internal" href="../role/">Role</a></li>
<li class="toctree-l2"><a class="reference internal" href="../orphans/">Orphan List and Associated Tooliing</a></li>
<li class="toctree-l2"><a class="reference internal" href="../oidc/">OpenID Connect Provider</a></li>
<li class="toctree-l2"><a class="reference internal" href="../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw/">radosgw 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/8/radosgw-admin/">radosgw-admin 手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../qat-accel/">使用 QAT 为加密和压缩提速</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s3select/">S3-select</a></li>
<li class="toctree-l2"><a class="reference internal" href="../lua-scripting/">Lua Scripting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../d3n_datacache/">D3N Data Cache</a></li>
<li class="toctree-l2"><a class="reference internal" href="../cloud-transition/">Cloud Transition</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Metrics</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#op-metrics">Op Metrics</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#op-metrics-labels">Op Metrics Labels</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#sending-metrics-to-prometheus">Sending Metrics to Prometheus</a></li>
<li class="toctree-l3"><a class="reference internal" href="#config-reference">Config Reference</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../uadk-accel/">UADK Acceleration for Compression</a></li>
<li class="toctree-l2"><a class="reference internal" href="../bucket_logging/">桶的日志记录</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../monitoring/">监控概览</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../hardware-monitoring/">硬件监控</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <section id="metrics">
<h1><a class="toc-backref" href="#id2" role="doc-backlink">Metrics</a><a class="headerlink" href="#metrics" title="Permalink to this heading"></a></h1>
<p>The Ceph Object Gateway uses <a class="reference internal" href="../../dev/perf_counters/#perf-counters"><span class="std std-ref">性能计数器</span></a> to track metrics. The counters can be labeled (<a class="reference internal" href="../../dev/perf_counters/#labeled-perf-counters"><span class="std std-ref">带标签的性能计数器</span></a>). When counters are labeled, they are stored in the Ceph Object Gateway specific caches.</p>
<p>These metrics can be sent to the time series database Prometheus to visualize a cluster wide view of usage data (ex: number of S3 put operations on a specific bucket) over time.</p>
<nav class="contents" id="contents">
<p class="topic-title">Contents</p>
<ul class="simple">
<li><p><a class="reference internal" href="#metrics" id="id2">Metrics</a></p>
<ul>
<li><p><a class="reference internal" href="#op-metrics" id="id3">Op Metrics</a></p>
<ul>
<li><p><a class="reference internal" href="#op-metrics-labels" id="id4">Op Metrics Labels</a></p>
<ul>
<li><p><a class="reference internal" href="#user-bucket-counter-caches" id="id5">User &amp; Bucket Counter Caches</a></p></li>
<li><p><a class="reference internal" href="#user-bucket-counter-cache-size-eviction" id="id6">User &amp; Bucket Counter Cache Size &amp; Eviction</a></p></li>
</ul>
</li>
</ul>
</li>
<li><p><a class="reference internal" href="#sending-metrics-to-prometheus" id="id7">Sending Metrics to Prometheus</a></p></li>
<li><p><a class="reference internal" href="#config-reference" id="id8">Config Reference</a></p></li>
</ul>
</li>
</ul>
</nav>
<section id="op-metrics">
<h2><a class="toc-backref" href="#id3" role="doc-backlink">Op Metrics</a><a class="headerlink" href="#op-metrics" title="Permalink to this heading"></a></h2>
<p>The following metrics related to S3 or Swift operations are tracked per Ceph Object Gateway.</p>
<table class="docutils align-default" id="id1">
<caption><span class="caption-text">Radosgw Op Metrics</span><a class="headerlink" href="#id1" title="Permalink to this table"></a></caption>
<colgroup>
<col style="width: 20.0%" />
<col style="width: 20.0%" />
<col style="width: 60.0%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>Name</p></th>
<th class="head"><p>Type</p></th>
<th class="head"><p>Description</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>put_obj_ops</p></td>
<td><p>Counter</p></td>
<td><p>Number of put operations</p></td>
</tr>
<tr class="row-odd"><td><p>put_obj_bytes</p></td>
<td><p>Counter</p></td>
<td><p>Number of bytes put</p></td>
</tr>
<tr class="row-even"><td><p>put_obj_lat</p></td>
<td><p>Guage</p></td>
<td><p>Total latency of put operations</p></td>
</tr>
<tr class="row-odd"><td><p>get_obj_ops</p></td>
<td><p>Counter</p></td>
<td><p>Number of get operations</p></td>
</tr>
<tr class="row-even"><td><p>get_obj_bytes</p></td>
<td><p>Counter</p></td>
<td><p>Number of bytes from get requests</p></td>
</tr>
<tr class="row-odd"><td><p>get_obj_lat</p></td>
<td><p>Guage</p></td>
<td><p>Total latency of get operations</p></td>
</tr>
<tr class="row-even"><td><p>del_obj_ops</p></td>
<td><p>Counter</p></td>
<td><p>Number of delete object operations</p></td>
</tr>
<tr class="row-odd"><td><p>del_obj_bytes</p></td>
<td><p>Counter</p></td>
<td><p>Number of bytes deleted</p></td>
</tr>
<tr class="row-even"><td><p>del_obj_lat</p></td>
<td><p>Guage</p></td>
<td><p>Total latency of delete object operations</p></td>
</tr>
<tr class="row-odd"><td><p>del_bucket_ops</p></td>
<td><p>Counter</p></td>
<td><p>Number of delete bucket operations</p></td>
</tr>
<tr class="row-even"><td><p>del_bucket_lat</p></td>
<td><p>Guage</p></td>
<td><p>Total latency of delete bucket operations</p></td>
</tr>
<tr class="row-odd"><td><p>copy_obj_ops</p></td>
<td><p>Counter</p></td>
<td><p>Number of copy object operations</p></td>
</tr>
<tr class="row-even"><td><p>copy_obj_bytes</p></td>
<td><p>Counter</p></td>
<td><p>Number of bytes copied</p></td>
</tr>
<tr class="row-odd"><td><p>copy_obj_lat</p></td>
<td><p>Guage</p></td>
<td><p>Total latency of copy object operations</p></td>
</tr>
<tr class="row-even"><td><p>list_object_ops</p></td>
<td><p>Counter</p></td>
<td><p>Number of list object operations</p></td>
</tr>
<tr class="row-odd"><td><p>list_object_lat</p></td>
<td><p>Guage</p></td>
<td><p>Total latency of list object operations</p></td>
</tr>
<tr class="row-even"><td><p>list_bucket_ops</p></td>
<td><p>Counter</p></td>
<td><p>Number of list bucket operations</p></td>
</tr>
<tr class="row-odd"><td><p>list_bucket_lat</p></td>
<td><p>Guage</p></td>
<td><p>Total latency of list bucket operations</p></td>
</tr>
</tbody>
</table>
<p>There are three different sections in the output of the <code class="docutils literal notranslate"><span class="pre">counter</span> <span class="pre">dump</span></code> and <code class="docutils literal notranslate"><span class="pre">counter</span> <span class="pre">schema</span></code> commands that show the op metrics and their information.
The sections are <code class="docutils literal notranslate"><span class="pre">rgw_op</span></code>, <code class="docutils literal notranslate"><span class="pre">rgw_op_per_user</span></code>, and <code class="docutils literal notranslate"><span class="pre">rgw_op_per_bucket</span></code>.</p>
<p>The counters in the <code class="docutils literal notranslate"><span class="pre">rgw_op</span></code> section reflect the totals of each op metric for a given Ceph Object Gateway.
The counters in the <code class="docutils literal notranslate"><span class="pre">rgw_op_per_user</span></code> and <code class="docutils literal notranslate"><span class="pre">rgw_op_per_bucket</span></code> sections are labeled counters of op metrics for a user or bucket respectively.</p>
<p>Information about op metrics can be seen in the <code class="docutils literal notranslate"><span class="pre">rgw_op</span></code> sections of the output of the <code class="docutils literal notranslate"><span class="pre">counter</span> <span class="pre">schema</span></code> command.</p>
<p>To view op metrics in the Ceph Object Gateway go to the <code class="docutils literal notranslate"><span class="pre">rgw_op</span></code> sections of the output of the <code class="docutils literal notranslate"><span class="pre">counter</span> <span class="pre">dump</span></code> command:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;rgw_op&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="p">{</span>
        <span class="s2">&quot;labels&quot;</span><span class="p">:</span> <span class="p">{},</span>
        <span class="s2">&quot;counters&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;put_obj_ops&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;put_obj_bytes&quot;</span><span class="p">:</span> <span class="mi">5327</span><span class="p">,</span>
            <span class="s2">&quot;put_obj_lat&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;avgcount&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
                <span class="s2">&quot;sum&quot;</span><span class="p">:</span> <span class="mf">2.818064835</span><span class="p">,</span>
                <span class="s2">&quot;avgtime&quot;</span><span class="p">:</span> <span class="mf">1.409032417</span>
            <span class="p">},</span>
            <span class="s2">&quot;get_obj_ops&quot;</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>
            <span class="s2">&quot;get_obj_bytes&quot;</span><span class="p">:</span> <span class="mi">5325</span><span class="p">,</span>
            <span class="s2">&quot;get_obj_lat&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;avgcount&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
                <span class="s2">&quot;sum&quot;</span><span class="p">:</span> <span class="mf">0.003000069</span><span class="p">,</span>
                <span class="s2">&quot;avgtime&quot;</span><span class="p">:</span> <span class="mf">0.001500034</span>
            <span class="p">},</span>
            <span class="o">...</span>
            <span class="s2">&quot;list_buckets_ops&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;list_buckets_lat&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;avgcount&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
                <span class="s2">&quot;sum&quot;</span><span class="p">:</span> <span class="mf">0.002300000</span><span class="p">,</span>
                <span class="s2">&quot;avgtime&quot;</span><span class="p">:</span> <span class="mf">0.002300000</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">},</span>
<span class="p">]</span>
</pre></div>
</div>
<section id="op-metrics-labels">
<h3><a class="toc-backref" href="#id4" role="doc-backlink">Op Metrics Labels</a><a class="headerlink" href="#op-metrics-labels" title="Permalink to this heading"></a></h3>
<p>Op metrics can also be tracked per-user or per-bucket. These metrics are exported to Prometheus with labels like Bucket = {name} or User = {userid}:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="s2">&quot;rgw_op_per_bucket&quot;</span><span class="p">:</span> <span class="p">[</span>
    <span class="o">...</span>
    <span class="p">{</span>
        <span class="s2">&quot;labels&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;Bucket&quot;</span><span class="p">:</span> <span class="s2">&quot;bucket1&quot;</span>
        <span class="p">},</span>
        <span class="s2">&quot;counters&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;put_obj_ops&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
            <span class="s2">&quot;put_obj_bytes&quot;</span><span class="p">:</span> <span class="mi">5327</span><span class="p">,</span>
            <span class="s2">&quot;put_obj_lat&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;avgcount&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
                <span class="s2">&quot;sum&quot;</span><span class="p">:</span> <span class="mf">2.818064835</span><span class="p">,</span>
                <span class="s2">&quot;avgtime&quot;</span><span class="p">:</span> <span class="mf">1.409032417</span>
            <span class="p">},</span>
            <span class="s2">&quot;get_obj_ops&quot;</span><span class="p">:</span> <span class="mi">5</span><span class="p">,</span>
            <span class="s2">&quot;get_obj_bytes&quot;</span><span class="p">:</span> <span class="mi">5325</span><span class="p">,</span>
            <span class="s2">&quot;get_obj_lat&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;avgcount&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
                <span class="s2">&quot;sum&quot;</span><span class="p">:</span> <span class="mf">0.003000069</span><span class="p">,</span>
                <span class="s2">&quot;avgtime&quot;</span><span class="p">:</span> <span class="mf">0.001500034</span>
            <span class="p">},</span>
            <span class="o">...</span>
            <span class="s2">&quot;list_buckets_ops&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="s2">&quot;list_buckets_lat&quot;</span><span class="p">:</span> <span class="p">{</span>
                <span class="s2">&quot;avgcount&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
                <span class="s2">&quot;sum&quot;</span><span class="p">:</span> <span class="mf">0.002300000</span><span class="p">,</span>
                <span class="s2">&quot;avgtime&quot;</span><span class="p">:</span> <span class="mf">0.002300000</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">},</span>
    <span class="o">...</span>
<span class="p">]</span>
</pre></div>
</div>
<p><a class="reference internal" href="../multitenancy/#rgw-multitenancy"><span class="std std-ref">RGW 多租户</span></a> allows to use buckets and users of the same name simultaneously. If a user or bucket lies under a tenant, a label for tenant in the form  Tenant = {tenantid} is added to the metric.</p>
<p>In a large system with many users and buckets, it may not be tractable to export all metrics to Prometheus. For that reason, the collection of these labeled metrics is disabled by default.</p>
<p>Once enabled, the working set of tracked users and buckets is constrained to limit memory and database usage. As a result, the collection of these labeled metrics will not always be reliable.</p>
<section id="user-bucket-counter-caches">
<h4><a class="toc-backref" href="#id5" role="doc-backlink">User &amp; Bucket Counter Caches</a><a class="headerlink" href="#user-bucket-counter-caches" title="Permalink to this heading"></a></h4>
<p>To track op metrics by user the Ceph Object Gateway the config value <code class="docutils literal notranslate"><span class="pre">rgw_user_counters_cache</span></code> must be set to <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
<p>To track op metrics by bucket the Ceph Object Gateway the config value <code class="docutils literal notranslate"><span class="pre">rgw_bucket_counters_cache</span></code> must be set to <code class="docutils literal notranslate"><span class="pre">true</span></code>.</p>
<p>These config values are set in Ceph via the command <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">config</span> <span class="pre">set</span> <span class="pre">client.rgw</span> <span class="pre">rgw_{user,bucket}_counters_cache</span> <span class="pre">true</span></code></p>
<p>Since the op metrics are labeled perf counters, they live in memory. If the Ceph Object Gateway is restarted or crashes, all counters in the Ceph Object Gateway, whether in a cache or not, are lost.</p>
</section>
<section id="user-bucket-counter-cache-size-eviction">
<h4><a class="toc-backref" href="#id6" role="doc-backlink">User &amp; Bucket Counter Cache Size &amp; Eviction</a><a class="headerlink" href="#user-bucket-counter-cache-size-eviction" title="Permalink to this heading"></a></h4>
<p>Both <code class="docutils literal notranslate"><span class="pre">rgw_user_counters_cache_size</span></code> and <code class="docutils literal notranslate"><span class="pre">rgw_bucket_counters_cache_size</span></code> can be used to set number of entries in each cache.</p>
<p>Counters are evicted from a cache once the number of counters in the cache are greater than the cache size config variable. The counters that are evicted are the least recently used (LRU).</p>
<p>For example if the number of buckets exceeded <code class="docutils literal notranslate"><span class="pre">rgw_bucket_counters_cache_size</span></code> by 1 and the counters with label <code class="docutils literal notranslate"><span class="pre">bucket1</span></code> were the last to be updated, the counters for <code class="docutils literal notranslate"><span class="pre">bucket1</span></code> would be evicted from the cache. If S3 operations tracked by the op metrics were done on <code class="docutils literal notranslate"><span class="pre">bucket1</span></code> after eviction, all of the metrics in the cache for <code class="docutils literal notranslate"><span class="pre">bucket1</span></code> would start at 0.</p>
<p>Cache sizing can depend on a number of factors. These factors include:</p>
<ol class="arabic simple">
<li><p>Number of users in the cluster</p></li>
<li><p>Number of buckets in the cluster</p></li>
<li><p>Memory usage of the Ceph Object Gateway</p></li>
<li><p>Disk and memory usage of Promtheus.</p></li>
</ol>
<p>To help calculate the Ceph Object Gateway’s memory usage of a cache, it should be noted that each cache entry, encompassing all of the op metrics, is 1360 bytes. This is an estimate and subject to change if metrics are added or removed from the op metrics list.</p>
</section>
</section>
</section>
<section id="sending-metrics-to-prometheus">
<h2><a class="toc-backref" href="#id7" role="doc-backlink">Sending Metrics to Prometheus</a><a class="headerlink" href="#sending-metrics-to-prometheus" title="Permalink to this heading"></a></h2>
<p>To get metrics from a Ceph Object Gateway into the time series database Prometheus, the ceph-exporter daemon must be running and configured to scrape the Radogw’s admin socket.</p>
<p>The ceph-exporter daemon scrapes the Ceph Object Gateway’s admin socket at a regular interval, defined by the config variable <code class="docutils literal notranslate"><span class="pre">exporter_stats_period</span></code>.</p>
<p>Prometheus has a configurable interval in which it scrapes the exporter (see: <a class="reference external" href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/">https://prometheus.io/docs/prometheus/latest/configuration/configuration/</a>).</p>
</section>
<section id="config-reference">
<h2><a class="toc-backref" href="#id8" role="doc-backlink">Config Reference</a><a class="headerlink" href="#config-reference" title="Permalink to this heading"></a></h2>
<p>The following rgw op metrics related settings can be set via <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">config</span> <span class="pre">set</span> <span class="pre">client.rgw</span> <span class="pre">CONFIG_VARIABLE</span> <span class="pre">VALUE</span></code>.</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-rgw_user_counters_cache">
<span class="sig-name descname"><span class="pre">rgw_user_counters_cache</span></span><a class="headerlink" href="#confval-rgw_user_counters_cache" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>enable a rgw perf counters cache for counters with user label</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-rgw_user_counters_cache_size"><code class="xref std std-confval docutils literal notranslate"><span class="pre">rgw_user_counters_cache_size</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-rgw_user_counters_cache_size">
<span class="sig-name descname"><span class="pre">rgw_user_counters_cache_size</span></span><a class="headerlink" href="#confval-rgw_user_counters_cache_size" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Number of labeled perf counters the user perf counters cache can store</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10000</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-rgw_user_counters_cache"><code class="xref std std-confval docutils literal notranslate"><span class="pre">rgw_user_counters_cache</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-rgw_bucket_counters_cache">
<span class="sig-name descname"><span class="pre">rgw_bucket_counters_cache</span></span><a class="headerlink" href="#confval-rgw_bucket_counters_cache" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>enable a rgw perf counters cache for counters with bucket label</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">bool</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">false</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-rgw_bucket_counters_cache_size"><code class="xref std std-confval docutils literal notranslate"><span class="pre">rgw_bucket_counters_cache_size</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<dl class="std confval">
<dt class="sig sig-object std" id="confval-rgw_bucket_counters_cache_size">
<span class="sig-name descname"><span class="pre">rgw_bucket_counters_cache_size</span></span><a class="headerlink" href="#confval-rgw_bucket_counters_cache_size" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Number of labeled perf counters the bucket perf counters cache can
store</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">uint</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">10000</span></code></p>
</dd>
<dt class="field-odd">see also<span class="colon">:</span></dt>
<dd class="field-odd"><p><a class="reference internal" href="#confval-rgw_bucket_counters_cache"><code class="xref std std-confval docutils literal notranslate"><span class="pre">rgw_bucket_counters_cache</span></code></a></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

<p>The following are notable ceph-exporter related settings can be set via <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">config</span> <span class="pre">set</span> <span class="pre">global</span> <span class="pre">CONFIG_VARIABLE</span> <span class="pre">VALUE</span></code>.</p>
<dl class="std confval">
<dt class="sig sig-object std" id="confval-exporter_stats_period">
<span class="sig-name descname"><span class="pre">exporter_stats_period</span></span><a class="headerlink" href="#confval-exporter_stats_period" title="Permalink to this definition"></a></dt>
<dd><blockquote>
<div><p>Time to wait before sending requests again to exporter server
(seconds)</p>
<dl class="field-list simple">
<dt class="field-odd">type<span class="colon">:</span></dt>
<dd class="field-odd"><p><code class="docutils literal notranslate"><span class="pre">int</span></code></p>
</dd>
<dt class="field-even">default<span class="colon">:</span></dt>
<dd class="field-even"><p><code class="docutils literal notranslate"><span class="pre">5</span></code></p>
</dd>
</dl>
</div></blockquote>
</dd></dl>

</section>
</section>



<div id="support-the-ceph-foundation" class="admonition note">
  <p class="first admonition-title">Brought to you by the Ceph Foundation</p>
  <p class="last">The Ceph Documentation is a community resource funded and hosted by the non-profit <a href="https://ceph.io/en/foundation/">Ceph Foundation</a>. If you would like to support this and our other efforts, please consider <a href="https://ceph.io/en/foundation/join/">joining now</a>.</p>
</div>


           </div>
           
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="../cloud-transition/" class="btn btn-neutral float-left" title="Cloud Transition" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
        <a href="../uadk-accel/" class="btn btn-neutral float-right" title="UADK Acceleration for Compression" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).</p>
  </div>

   

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>